package com.gxr.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dao.ObjectDao;
import com.pro.bean.Unit;
import com.pro.bean.Users;

public class DelCmpServlet extends HttpServlet {

	/**
	 * ���ɾ��ť ɾ������Ϣ
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request,response);
	}

	/**
	 * 
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		ObjectDao objectDao=new ObjectDao();
		
		int unitId=Integer.parseInt(request.getParameter("unitId"));
		objectDao.delete(unitId,new Unit() );
		
		RequestDispatcher dispatcher=request.getRequestDispatcher("SearchCmpServlet");
		dispatcher.forward(request, response);
		
	}

}
